public class Test01 {
	public static void main(String[] args) {
		for(int i=10;i<2000;i++) {
			int n = i;
			int sum = 0;
			while(n>0) {
				int t = n%10;
				n/=10;
				sum+= t*t*t;
			}
			if(sum==i) {
				System.out.println(i);	
			}
		}
	}
}